wayland: Set a more correct xdg_surface application id
authorJonas Ådahl <jadahl@gmail.com>
Mon, 23 Mar 2015 05:08:09 +0000 (13:08 +0800)
committerJonas Ådahl <jadahl@gmail.com>
Tue, 31 Mar 2015 04:37:50 +0000 (12:37 +0800)
commit71256a0f94972be8220049b1c99dc2db61e56b5a
tree4ee8a5e3cd7ee24bc3ccdfa1bba21ec445a19ebc
parent5a0d718239992680d99e4fda8a54992b19abd897
wayland: Set a more correct xdg_surface application id

The "app_id" of a xdg_surface should be the ID that can potentially be
used to get the DBUS name or the .desktop file.

For GtkApplication programs this is often the ID passed when creating the
GtkApplication object, so when available lets use that.

As fallbacks, first try g_get_prgname as it often corresponds to the
basename part of the .dektop file for non-GtkApplication programs.
Otherwise use gdk_get_program_class, even though that string usually
doesn't conform to the expectations of xdg_surface.set_application_id.

https://bugzilla.gnome.org/show_bug.cgi?id=746435
gdk/wayland/gdkwindow-wayland.c
gtk/gtkapplication-wayland.c